package com.example.myapplication.module_user;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.example.myapplication.R;
import com.example.myapplication.data.GlobalData;
import com.example.myapplication.utils.QRUtil;
import com.google.gson.Gson;

public class MyQRCodeActivity extends AppCompatActivity {



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_qrcode);

        ImageView img = this.findViewById(R.id.img_qr);
        Gson gson = new Gson();
        Bitmap h = QRUtil.createQRCodeBitmap(gson.toJson(GlobalData.curUser),
                330, 330, "UTF-8", "H", "2", Color.BLACK, Color.WHITE);
        img.setImageBitmap(h);


    }


}